const cheerio = require('cheerio'),
$ = cheerio.load('<h1 class="title">hello world</h1>');
$('h1.title').text('hello there!');
$('h1').addClass('welcome');
console.log($.html());